{include file="public/header" /} // 包含头部模版header
    <!-- 内容主体区域 -->
    <div class="layui-body">
    <div style="padding: 15px;">
        <div>
            <a class="layui-btn" href="add">添加员工</a>
        </div>
        <table class="layui-table">
            <thead>
            <tr>
                <th>编号</th>
                <th>姓名</th>
                <th>年龄</th>
                <th>性别</th>
                <th>部门</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            {volist name="emps" id="v"}
            <tr>
                <td>{$v.Eno}</td>
                <td>{$v.Ename}</td>
                <td>{$v.Eage}</td>
                <td>{$v.Egender}</td>
                <td>{$v.dept.Dname}</td>
                <td>
                    <a href="{:url('emplist/edit',['no'=>$v.Eno])}" class="layui-btn layui-btn-xs">编辑</a>
                    <button onclick="showDel('{$v.Eno}','{$v.Ename}')" class="layui-btn layui-btn-danger layui-btn-xs">删除</button>
                </td>
            </tr>
            {/volist}

            </tbody>
        </table>
        {$emps->render()}
    </div>
</div>
</div>
<div class="layui-footer">
    <!-- 底部固定区域 -->
    © layui.com - 底部固定区域
</div>

<script src="__STATIC__/layui/layui.js"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;

    });
    layui.use(['element','layer'], function(){
        var element = element;});

    function showDel(no,name) {
        var layer = layui.layer;
        layer.confirm('确认删除'+name+'？', {
            btn: ['确认', '取消'] //可以无限个按钮
        }, function (index, layero) {
            //按钮【按钮一】的回调
            location.href="{:url('emplist/del')}"+"?no="+no;
        }, function (index) {
            //按钮【按钮二】的回调
        });
    }
</script>
</body>
</html>